<?php

namespace App\Console\Commands;

use App\Models\GoldRound;
use Illuminate\Console\Command;
use App\Supports\Withdraw\WithdrawOverChecker;

class CheckStormCache extends Command
{
    protected $signature = 'cc:check-storm-cache';

    protected $description = "Check storm products cache";

    public function handle()
    {
	    $data = $this->ask("Input GoldRound id like: 1");

	    if (empty((int)$data)) {
	    	GoldRound::checkAllCache();
	    	return;
	    }

	    if (!$round = GoldRound::find($data)) {
	    	$this->error('Expired GoldRound does not exist.');
	    	return;
	    }

	    GoldRound::checkCache($round);
    }
}
